<?php
/**
 * @version $Id: admin.sketchup.html.php,v 1.1 2009/06/03 00:36:07 dgravato Exp $
 * @package    sketchup
 * @subpackage 
 * @author     Chris Borkowski {@link http://www.guggenheim.org}
 * @author     Created on 30-Mar-2009
 */

// no direct access

defined( '_JEXEC' ) or die( 'Restricted access' ); 

class HTML_sketchups 
{ 
	function editSketchup( $row, $lists, $option ) 
	{ 
		$editor =& JFactory::getEditor(); 
		JHTML::_('behavior.calendar'); 
		?> 
		<form action="index.php" method="post" name="adminForm" id="adminForm"> 
		<fieldset class="adminform"> 
		<legend>Details</legend> 
		<table class="admintable"> 
		<tr> 
		  <td width="100" align="right" class="key"> 
			Full Name: 
		  </td> 
		  <td> 
			<input class="text_area" type="text" name="fullname"  id="fullname" size="50" maxlength="250" 
			   value="<?php echo $row->fullname;?>" /> 
		  </td> 
		</tr> 
		<tr> 
		  <td width="100" align="right" class="key"> 
			Email: 
		  </td> 
		  <td> 
			<input class="text_area" type="text" name="email" 
			   id="email" size="50" maxlength="250" 
			   value="<?php echo $row->email;?>" /> 
		  </td> 
		</tr> 
		<tr> 
		  <td width="100" align="right" class="key"> 
			Project Title: 
		  </td> 
		  <td> 
			<input class="text_area" type="text" name="p_title" 
			   id="p_title" size="50" maxlength="250" 
			   value="<?php echo $row->p_title;?>" /> 
		  </td> 
		</tr> 
		<tr> 
		  <td width="100" align="right" class="key"> 
			Project Decription: 
		  </td> 
		  <td> 
			<?php 
			echo $editor->display( 'p_description',	 $row->p_description , '100%', '250', '40', '10' ) ; 
			?> 
		  </td> 
		</tr> 
		<tr> 
		  <td width="100" align="right" class="key"> 
			Image 1: 
		  </td> 
		  <td> 
			<input class="text_area" type="text" name="image1" 
			   id="image1" size="50" maxlength="255" 
			   value="<?php echo $row->image1;?>" /> 
		  </td> 
		</tr> 
		<tr> 
		  <td width="100" align="right" class="key"> 
			Thumbnail 1: 
		  </td> 
		  <td> 
			<input class="text_area" type="text" name="thumb1" 
			   id="thumb1" size="50" maxlength="255" 
			   value="<?php echo $row->thumb1;?>" /> 
		  </td> 
		</tr>
		
		<tr> 
		  <td width="100" align="right" class="key"> 
			Image 2: 
		  </td> 
		  <td> 
			<input class="text_area" type="text" name="image2" 
			   id="image2" size="50" maxlength="255" 
			   value="<?php echo $row->image2;?>" /> 
		  </td> 
		</tr>
			<tr> 
		  <td width="100" align="right" class="key"> 
			Thumbnail 2: 
		  </td> 
		  <td> 
			<input class="text_area" type="text" name="thumb2" 
			   id="thumb2" size="50" maxlength="255" 
			   value="<?php echo $row->thumb2;?>" /> 
		  </td> 
		</tr>
		<tr> 
		  <td width="100" align="right" class="key"> 
			Image 3: 
		  </td> 
		  <td> 
			<input class="text_area" type="text" name="image3" 
			   id="image3" size="50" maxlength="255" 
			   value="<?php echo $row->image3;?>" /> 
		  </td> 
		</tr>
			<tr> 
		  <td width="100" align="right" class="key"> 
			Thumbnail 3: 
		  </td> 
		  <td> 
			<input class="text_area" type="text" name="thumb3" 
			   id="thumb3" size="50" maxlength="255" 
			   value="<?php echo $row->thumb3;?>" /> 
		  </td> 
		</tr>
		<tr> 
		  <td width="100" align="right" class="key"> 
			3D Warehouse URL: 
		  </td> 
		  <td> 
			<input class="text_area" type="text" name="m_url" 
				 id="m_url" size="50" maxlength="250" 
				 value="<?php echo $row->m_url;?>" /> 
		  </td> 
		</tr> 
		<tr> 
		  <td width="100" align="right" class="key"> 
			Google/YouTube Video URL: 
		  </td> 
		  <td> 
			<input class="text_area" type="text" name="v_url" id="v_url" size="50" maxlength="250" 
			     value="<?php echo $row->v_url;?>" /> 
		  </td> 
		</tr>
		<tr> 
		  <td width="100" align="right" class="key"> 
			Submitted Date: 
		  </td> 
		  <td> 
			<?php echo JHTML::calendar($row->sub_date, 'sub_date', 'sub_date'); ?>
		  </td> 
		</tr> 
		<tr> 
		  <td width="100" align="right" class="key"> 
			Finalist: 
		  </td> 
		  <td> 
			<?php 
			echo $lists['finalist']; 
			?> 
		  </td> 
		</tr>
		<tr> 
		  <td width="100" align="right" class="key"> 
			Published: 
		  </td> 
		  <td> 
			<?php 
			echo $lists['published']; 
			?> 
		  </td> 
		</tr> 
		</table> 
		</fieldset> 
		<input type="hidden" name="id" value="<?php echo $row->id; ?>" /> 
		<input type="hidden" name="option" value="<?php echo $option;?>" />
		<input type="hidden" name="task" value="" /> 
		<?php echo JHTML::_( 'form.token' ); ?>
		</form> 
		<?php 
	}
	
	function showSketchups( $option, &$rows ) 
	{ 
	  ?> 
	  <form action="index.php" method="post" name="adminForm"> 
	  <table class="adminlist"> 
	    <thead> 
	      <tr> 
	        <th width="20"> 
	          <input type="checkbox" name="toggle" 
	               value="" onclick="checkAll(<?php echo 
	               count( $rows ); ?>);" /> 
	        </th> 
	        <th class="title">Full Name</th> 
	        <th width="25%">email</th> 
	        <th width="25%">Project Titile</th> 
	        <th width="20%">Submitted Date</th> 
	   		<th width="5%" nowrap="nowrap">Finalist</th> 
	        <th width="5%" nowrap="nowrap">Published</th> 
	      </tr> 
	    </thead> 
	    <?php
		jimport('joomla.filter.output');
	    $k = 0;
	    for ($i=0, $n=count( $rows ); $i < $n; $i++) 
	    {
			$row = &$rows[$i]; 
			$checked = JHTML::_('grid.id', $i, $row->id );
			$published = JHTML::_('grid.published', $row, $i );
			$link = JFilterOutput::ampReplace( 'index.php?option=' . $option . '&task=edit&cid[]='. $row->id );
	      ?> 
	      <tr class="<?php echo "row$k"; ?>"> 
	        <td> 
	          <?php echo $checked; ?> 
	        </td> 
	        <td>
			<a href="<?php echo $link; ?>"> 
	          <?php echo $row->fullname; ?></a>
	        </td> 
	        <td> 
	          <?php echo $row->email; ?> 
	        </td> 
	        <td> 
	        <a href="<?php echo $link; ?>"> 
	          <?php echo $row->p_title; ?> </a>
	        </td>
	        <td> 
	          <?php echo $row->sub_date; ?> 
	        </td> 
	    	 <td align="center"> 
	          <?php  if ($row->finalist == "1") echo "yes"; else echo "no";?> 
	        </td> 
	        <td align="center"> 
	          <?php echo $published;?> 
	        </td> 
	      </tr> 
	      <?php 
	      $k = 1 - $k; 
	    } 
	    ?> 
	  </table> 
	  <input type="hidden" name="option" value="<?php echo $option;?>" /> 
	  <input type="hidden" name="task" value="" /> 
	  <input type="hidden" name="boxchecked" value="0" /> 
	  <?php echo JHTML::_( 'form.token' ); ?>
	  </form> 
	  <?php 
	}
}
?>